import requests from "./request";

export default {
    //查询种类表
    getCategories() {
        return requests({
            url: `bcra/category/getCategories`,
            method: "get",
        })
    },
    //根据id查看字典
    getDictionaryById(id) {
        return requests({
            url: `bcra/dictionary/getById/${id}`,
            method: "get",
        })
    },
    //根据种类id查看字典
    getDictionary(categoryId, current, size) {
        return requests({
            url: `bcra/dictionary/getDictionary/${categoryId}/${current}/${size}`,
            method: "get",
        })
    },
    //删除某个种类，对应的字典数据也删除
    deleteCategory(id) {
        return requests({
            url: `bcra/category/deleteCategory/${id}`,
            method: "delete",
        })
    },
    //删除某个字典数据
    deleteDictionary(id) {
        return requests({
            url: `bcra/dictionary/deleteDictionary/${id}`,
            method: "delete",
        })
    },
    //修改字典数据表
    updateDictionary(body) {
        return requests({
            url: `bcra/dictionary/updateDictionary`,
            method: "post",
            data: body
        })
    },

    //增加字典种类
    creatNewCategory(body) {
        return requests({
            url: `bcra/category/creatCategory`,
            method: "post",
            data: body
        })
    },
    //增加字典数据
    creatNewDictionary(body) {
        return requests({
            url: `bcra/dictionary/creatDictionary`,
            method: "post",
            data: body
        })
    },

}